//
//  SMGlobalMethod.h
//  Smios
//
//  Created by hao on 15/11/27.
//  Copyright (c) 2015年 sanmi. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface SMGlobalMethod : NSObject
//处理丢精
+(NSString *)reviseString:(NSString *)str;

+(NSString *)toUpper:(NSString *)str;
//yyyy年MM月dd日 HH:mm
+ (NSString *)getTimeFromTimeSpToComFormat:(NSString *)timeSp;
//date转时间yyyyMMdd
+(NSString *)getTimeFromTimeDaY:(NSDate *)date;
//时间戳转时间
+(NSString *)getTimeFromTimeSp:(NSString *)timeSp;
//时间戳转时间
+(NSString *)getTimeFromShortTimeSpY:(NSString *)shortTimeSp;
//时间戳转时间yyyy-MM-dd
+(NSString *)getTimeFromShortTimeSp:(NSString *)shortTimeSp;
//date转时间
+(NSString *)getTimeFromTimeDa:(NSDate *)date;
+(NSString *)getTimeFromShortTimeDa:(NSDate *)date;
//时间文本转dateShort
+(NSDate *)getTimeDateFromeShortTimeStryy:(NSString *)timeStr;
//将时间转为时间戳
//+ (NSString *)getTimetroWith:
//获取当前时间戳
+(NSString *)getTimeSp;
//时间文本转date
+(NSDate *)getTimeDateFromeTimeStr:(NSString *)timeStr;
+(NSDate *)getTimeDateFromeShortTimeStr:(NSString *)timeStr;
//date转时间戳
+(NSString *)getTimeSpFromeTimeDate:(NSDate *)date;
//时间文本转date(YYYYMMddHHmm)
+ (NSDate *)getTimeDateFromeTimeStrWithYYY:(NSString *)timeStr;
//date转时间yyyyMMddHHmm
+(NSString *)getTimeFromTimeDaYY:(NSDate *)date;

+(NSString *)getTimeFrom13TimeSp:(NSString *)timeSp;
//时间文本转为时间戳(YYYY-MM-dd)
+ (NSString *)getTimeSpWithTime:(NSString *)time;
//自动消失的提示框
+(void)showMessage:(NSString *)message;

#pragma mark-- 正则判断
//邮箱
+ (BOOL) validateEmail:(NSString *)email;
//手机号码验证
+ (BOOL) validateMobile:(NSString *)mobile;

+ (BOOL)checkTelNumber:(NSString*) telNumber;

//电话号验证
+ (BOOL)validateIsMobileNumber:(NSString *)mobileNum;

//车牌号验证
+ (BOOL) validateCarNo:(NSString *)carNo;
//车型
+ (BOOL) validateCarType:(NSString *)CarType;
//用户名
+ (BOOL) validateUserName:(NSString *)name;
//密码
+ (BOOL) validatePassword:(NSString *)passWord;
//昵称
+ (BOOL) validateNickname:(NSString *)nickname;
//身份证号
+ (BOOL) validateIdentityCard: (NSString *)identityCard;
//color转image
//+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;
#pragma mark- 各类型数据转换
//字典转data
+(NSData*)returnDataWithDictionary:(NSDictionary*)dict;
//字典转json串
+(NSString*)returnDictionaryToJson:(NSDictionary *)dic;

#pragma mark-- 清理缓存
//计算单个文件大小
+(float)fileSizeAtPath:(NSString *)path;
/**阿拉伯数字转汉字数字*/
+(NSString *)translation:(NSString *)arebic;
//银行卡判定
+ (NSString *)returnBankName:(NSString*) idCard;
/**MD5加密*/
+ (NSString *)md5String:(NSString *)str;
//整数还是浮点
+(NSString *)IntegerAndFloatingPoint:(NSString *)num;
//判断字符串是否为空
+ (BOOL) isBlankString:(NSString *)string;




@end
